﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ACM.UserControls
{
    public partial class ucYesNo : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public string Value
        {
            get {
                if (chkYes.Checked)
                    return YesValue;
                else if (chkNo.Checked)
                    return NoValue;
                else
                    return null;
            }
            set {
                chkYes.Checked = false;
                chkNo.Checked = false;

                if (value == YesValue)
                    chkYes.Checked = true;
                else if (value == NoValue)
                    chkNo.Checked = true;
            }
        }

        public int tx_id {
            get { return Convert.ToInt32(hdfTxId.Value); }
            set { hdfTxId.Value = value.ToString(); }
        }

        public string YesValue { get; set; }
        public string NoValue { get; set; }
        public string YesText { 
            get { return chkYes.Text; }
            set { chkYes.Text = value; }
        }
        public string NoText
        {
            get { return chkNo.Text; }
            set { chkNo.Text = value; }
        }
    }
}